package cn.monkey.transport.core;

import reactor.core.publisher.Mono;

import java.util.concurrent.Flow;

public interface DelegateExchange extends Exchange {
    Exchange delegate();

    @Override
    default String id() {
        return this.delegate().id();
    }

    @Override
    default Inbound inbound() {
        return this.delegate().inbound();
    }

    @Override
    default Outbound outbound() {
        return this.delegate().outbound();
    }

    @Override
    default <T> T setAttribute(String key, T val) {
        return this.delegate().setAttribute(key, val);
    }

    @Override
    default <T> T getAttribute(String key) {
        return this.delegate().getAttribute(key);
    }

    default Mono<Void> close() {
        return this.delegate().close();
    }

    @Override
    default boolean isActive() {
        return this.delegate().isActive();
    }

    @Override
    default Mono<Void> write(Object o) {
        return this.delegate().write(o);
    }

    @Override
    default Mono<Void> flush() {
        return this.delegate().flush();
    }

    @Override
    default Mono<Void> writeAndFlush(Object o) {
        return this.delegate().writeAndFlush(o);
    }

    @Override
    default Exchange bind() {
        this.delegate().bind();
        return this;
    }
}
